package org.lionsteins.eddie.server;

import java.util.*;
import java.io.*;
import java.sql.*;

import org.hibernate.Query;
import org.hibernate.Session;
import org.lionsteins.eddie.domain.Alert;

public class AlertUtil implements Serializable {




	public static Alert lookup(String id) {
		
		Alert bean = null;
		try{
   			String sql = "from Alert where id = '" +
                		id + "'";
   			
   			Session hSession = SessionFactoryUtil.getSessionFactory().openSession();

   			hSession.beginTransaction();

   			Query query = hSession.createQuery(sql);
   				
   			ArrayList temp = (ArrayList) query.list();
   			
   			if (temp != null && temp.size() > 0){
   				bean = (Alert)temp.get(0);
   			}


		
		}catch(Exception e){
   			e.printStackTrace();
		}finally{
		}//end try
		return bean;
	
	}
}
